package base.day25;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class DemoCallable2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //第一条线程
        MyCallable2 mc=new MyCallable2();
        FutureTask<String> ft=new FutureTask<>(mc);
        Thread t1=new Thread(ft);
        t1.setName("飞机");
        //设置优先级
        t1.setPriority(10);
        //显示优先级
        System.out.println(t1.getPriority());
        t1.start();

        //第二条线程
        MyCallable2 mc1=new MyCallable2();
        FutureTask<String> ft1=new FutureTask<>(mc1);
        Thread t2=new Thread(ft1);
        t2.setName("坦克");
        //设置优先级
        t2.setPriority(1);
        //显示优先级
        System.out.println(t2.getPriority());
        t2.start();
    }
}
